package com.lan.model.symbol;


import com.alibaba.fastjson.JSON;
import com.lan.model.Type;
import org.antlr.v4.runtime.ParserRuleContext;

import java.util.Map;

/**
 * symbols
 * json   List Variable  name  key value
 * array  List Variable
 * <p>
 *      Object  Map  List
 * <p>
 * List 中不能存在 方法 表达式
 */
public class Json extends Scope {

    private Type type;

    private Object data;

    public Json(String id, String name, Scope scope, Type type, ParserRuleContext ctx) {
        this.id = id;
        this.name = name;
        this.scope = scope;
        this.type = type;
        this.ctx = ctx;
    }

    public Type type() {
        return type;
    }

    public Object getCopyData() {
        return JSON.toJSON(data);
    }

    public Object getData() {
        return data;
    }


    public void setData(Object data) {
        this.data = data;
    }
}
